package com.koushikdutta.async.http.body;

import com.koushikdutta.async.DataSink;
import com.koushikdutta.async.callback.CompletedCallback;
import com.koushikdutta.async.http.Multimap;
import com.koushikdutta.async.http.libcore.RawHeaders;

public class Part {
    static final /* synthetic */ boolean $assertionsDisabled = (!Part.class.desiredAssertionStatus());
    private long length = -1;
    Multimap mContentDisposition;
    RawHeaders mHeaders;

    public Part(RawHeaders headers) {
        this.mHeaders = headers;
        this.mContentDisposition = Multimap.parseHeader(this.mHeaders, "Content-Disposition");
    }

    public String getName() {
        return this.mContentDisposition.getString("name");
    }

    public RawHeaders getRawHeaders() {
        return this.mHeaders;
    }

    public boolean isFile() {
        return this.mContentDisposition.containsKey("filename");
    }

    public long length() {
        return this.length;
    }

    public void write(DataSink sink, CompletedCallback callback) {
        if (!$assertionsDisabled) {
            throw new AssertionError();
        }
    }
}
